package cn.edu.ecut.annotation;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.Arrays;

public class AnnotationTest {

	public static void main(String[] args) throws Exception {
		
		Class<?> c = Panda.class ;
		
		Field idField = c.getDeclaredField( "id" ); // NoSuchFieldException
		
		Annotation idAssign = idField.getAnnotation( Assign.class );
		
		System.out.println( idAssign instanceof Assign ); // true
		
		System.out.println( idAssign instanceof Annotation ); // true
		
		Class<?> ac = Assign.class ; // idAssign.getClass();
		System.out.println( ac );
		
		Class<?>[] interfaces = ac.getInterfaces();
		System.out.println( Arrays.toString( interfaces ) );
		
	}

}
